package com.wangmeng.book.client.frame;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

/**
 * User: 王猛
 * Date: 13-10-14
 */
class MyCheckAllRenderer extends JCheckBox implements TableCellRenderer {
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        this.setHorizontalAlignment(JCheckBox.CENTER);
        if (Boolean.valueOf(value.toString())) {
            this.setSelected(true);
        }
        return this;
    }
}
